home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Source.bin / Circle.java < prev    next >
Text File  |  1998-08-21  |  1KB  |  46 lines

  1. package symantec.itools.awt.shape;
  2.  
  3. //  08/13/97    LAB    Fixed reshape to set the size of the component to the min of the width and
  4. //                    height. This addresses Mac Bug #7139.  Changed the version to 1.1.
  5. //  08/30/97    LAB    Fixed rehape problem when only one dimension changed (Addresses Mac Bug #7686)
  6.  
  7. /**
  8.  * This is a circle shape component.
  9.  * @version 1.1, August 13, 1997
  10.  * @author Symantec
  11.  */
  12. public class Circle extends Ellipse
  13. {
  14.     /**
  15.      * Constructs a default Circle.
  16.      */
  17.     public Circle()
  18.     {
  19.     }
  20.  
  21.     /**
  22.      * Moves and/or resizes this component.
  23.      * This is a standard Java AWT method which gets called to move and/or
  24.      * resize this component. Components that are in containers with layout
  25.      * managers should not call this method, but rely on the layout manager
  26.      * instead.
  27.      *
  28.      * @param x horizontal position in the parent's coordinate space
  29.      * @param y vertical position in the parent's coordinate space
  30.      * @param width the new width
  31.      * @param height the new height
  32.      */
  33.     public void reshape(int x, int y, int width, int height)
  34.     {
  35.         if(this.width == width)
  36.             this.width = this.height = height;
  37.         else if(this.height == height)
  38.             this.width = this.height = width;
  39.         else
  40.             this.width = this.height = Math.min(width, height);
  41.  
  42.         super.reshape(x, y, this.width, this.height);
  43.     }
  44. }
  45.  
  46.